/**
 *	VisualGroup JavaScript prototype Classes, version draf
 *  (c) 2008 Bill Vison <vison_ruan@126.com>
 *
 *
/*--------------------------------------------------------------------------*/
using("Vsg.EntityRecord");
/**
 * @constructor
 */
Vsg.EntityRecord.GenericEntityRecord = function() {
	
	/** GenericEntityRecord constructor init attribute */
	var $_attrs = {};
	
	Vsg.EntityRecord.GenericEntityRecord.superclass.constructor.call(this,$_attrs);
	
	


}



// --- set the override
var $overrideMethods = new Object();

// extend object
Ext.extend(Vsg.EntityRecord.GenericEntityRecord, Ext.util.Observable, $overrideMethods);

/** set/get the property */
Vsg.EntityRecord.GenericEntityRecord.prototype = {
	
	$_mappingArray:null,
	
	/** 
 	* implement interface method "createEntity" 
 	* the method is invoke Ext.data.Record.create,
 	* return the object is type of Ext.data.Record
 	*/	
	createEntity:function() {
		var $Entity = Ext.data.Record.create(this.$_mappingArray);
		return $Entity;
	},
	
	/** 
 	* implement interface method "addMapping" 
 	* @param {object} The mapping object is used for Ext.data.Record ,please see Ext.data.Record.create
 	*/	
	addMapping:function($mapObj) {
		if (this.$_mappingArray == null) {
			this.$_mappingArray = [];
		}
		this.$_mappingArray.push($mapObj);
	},
	
	/** implement interface method "setAllMapping" */		
	setAllMapping:function($mappingArray) {
		this.$_mappingArray = $mappingArray;
	},
	
	/** defined the get mapping */
	getAllMapping:function() {
		return this.$_mappingArray;
	}
	
};
	
(function() {
	try {
		Interface.ensureImplements(new Vsg.EntityRecord.GenericEntityRecord(), Vsg.EntityRecord);	
	} catch (e) {
		Ext.log("Class Implement Error :"+"[Vsg.EntityRecord.GenericEntityRecord] , " + e);
	}		  
})();